package lec07datastructure;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class C {
    static Scanner cin = new Scanner(new BufferedInputStream(System.in));//大量输入优化版本
    static PrintWriter cout = new PrintWriter(new BufferedOutputStream(System.out));//大量输出优化版本
    static PrintWriter cerr = new PrintWriter(System.err, true);//开启调试模式,一般输出量不大，不需要buffered

    public static void main(String[] args) {
        //TODO AOJ开启你的ACM传奇人生
        cerr.println("----Start your ACM legendary life with AOJ(www.webturing.com)----");
        Queue q = new Queue();
        int n = cin.nextInt();
        for (int i = 0; i < n; i++) {
            q.push(cin.nextInt());
        }
        while (q.size() > 0) {
            cout.print(q.front() + " ");
            q.pop();
            if (q.size() == 0) break;
            int x = q.front();
            q.pop();
            q.push(x);

        }
        cin.close();//关闭输入流
        cout.close();//关闭输出流，这是必须的，否则一般不会自动刷新缓冲区

    }

    static class Queue {
        int[] data = new int[200000 + 100];
        int head = 0;
        int tail = -1;

        //data[head,tail]
        void push(int x) {
            data[++tail] = x;
        }

        void pop() {
            ++head;
        }

        int front() {
            return data[head];
        }

        int size() {
            return tail - head + 1;
        }

        int get(int x) {
            return data[x + head];
        }
    }
}
